<?php

namespace app\models\article;

use Yii;

/**
 * This is the model class for table "{{%article}}".
 *
 * @property string $id
 * @property string $title
 * @property string $short_title
 * @property string $thumb
 * @property string $description
 * @property string $content
 * @property string $search_key
 * @property integer $channel_id
 * @property integer $add_time
 * @property integer $edit_time
 * @property string $html_path
 * @property integer $is_hidden
 * @property integer $is_del
 */
class Article extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%article}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['content'], 'string'],
            [['channel_id', 'add_time', 'edit_time', 'is_hidden', 'is_del'], 'integer'],
            [['title', 'short_title' ,'description', 'search_key', 'html_path'], 'string', 'max' => 255],
            [['title',], 'required',],
            [['thumb'],'file'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'title' => '标题',
            'short_title' => '短标题',
            'thumb' => '预览图',
            'description' => '摘要（描述）',
            'content' => '（文章内容）内容',
            'search_key' => '搜索关键字（拼音）',
            'channel_id' => '频道id',
            'add_time' => '',
            'edit_time' => '',
            'html_path' => '',
            'is_hidden' => '',
            'is_del' => '',
        ];
    }
}
